/*
 * Created by SharpDevelop.
 * User: c0148643
 * Date: 24/05/2010
 * Time: 14:36
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;

namespace pontoIndividual
{
	/// <summary>
	/// Description of frmConfiguracoes.
	/// </summary>
	public partial class frmConfiguracoes : Form
	{
		configuracao c;
		
		public frmConfiguracoes()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
			
			c = new configuracao();
			
			chkBackupAutomatico.Checked = c.HabilitarBackup == estadoConfig.Habilitado ? true : false;
			chkAlertaPonto.Checked = c.AvisarHorarios == estadoConfig.Habilitado ? true : false;
			
			timeBackup.Text = c.HorarioBackup;
			timeHoraAlmoco.Text = c.HorarioAlmoco;
			timeHoraSaida.Text = c.HorarioSaida;
			
			txtPastaBackupAutomatico.Text = c.PastaBackup;
			txtPastaBackupPendrive.Text = c.PastaBackupPendrive;
			txtPastaBackupRede.Text = c.PastaBackupRede;
			txtPastaBackupAutomaticoDocumentacao.Text = c.PastaBackupDocumentacao;
			
		}
		
		
		
		void Button2Click(object sender, EventArgs e)
		{
			c.AvisarHorarios = chkAlertaPonto.Checked == true ? estadoConfig.Habilitado : estadoConfig.Desabilitado;
			c.HabilitarBackup = chkBackupAutomatico.Checked == true ? estadoConfig.Habilitado : estadoConfig.Desabilitado;
			
			c.HorarioAlmoco = timeHoraAlmoco.Text;
			c.HorarioBackup = timeBackup.Text;
			c.HorarioSaida = timeHoraSaida.Text;
			
			c.PastaBackup = txtPastaBackupAutomatico.Text;
			c.PastaBackupPendrive = txtPastaBackupPendrive.Text;
			c.PastaBackupRede = txtPastaBackupRede.Text;
			c.PastaBackupDocumentacao = txtPastaBackupAutomaticoDocumentacao.Text;
			
			c.gravar();
		}
		
		void Button1Click(object sender, EventArgs e)
		{
			this.Close();
		}
	}
}
